#include <gtkmm.h>
#include <string.h>



void onRunAll(){
	printf("\nrunAll\n");
}

int main(int argc, char** argv) {
Gtk::Main kit(argc, argv);
	char file[100];
	if(argc>1){
		strcpy(file, argv[1]);
	}else{
		printf("filename?:");
		scanf("%s", file);
	}
    Glib::RefPtr<Gtk::Builder> builder =   
         Gtk::Builder::create_from_file(file);
	Glib::RefPtr<Gtk::Action>  pAction=
		Glib::RefPtr<Gtk::Action>::cast_dynamic(builder->get_object("runAllAction"));
	pAction->signal_activate().connect(sigc::ptr_fun(onRunAll) );
	
    Gtk::Window* pMyWidget = new Gtk::window();
    builder->get_widget("handler", pMyWidget);
	Gtk::Window win;
	win.add(*pMyWidget);
	win.show_all();
	kit.run(win);
}
